import { Profile } from '@/types/user'

// 本地存储的方法
const PROFILE_KEY = 'rabbit-profile'

export function setProfile(profile: Profile): void {
  localStorage.setItem(PROFILE_KEY, JSON.stringify(profile))
}
export function getProfile(): Profile {
  return JSON.parse(localStorage.getItem(PROFILE_KEY) || '{}')
}
export function removeProfile(): void {
  localStorage.removeItem(PROFILE_KEY)
}
